import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:俩个类之间的调用和引用
 * User: 石仲夏
 */
class Student{
    public String name;
    private int age;
    private float score;
    String stuNum;
    public static String classroom;
    public Student(){
        System.out.println("构造方法");
    }
    {
        this.age=18;
        this.name="lishi";
        this.score=98.5F;
        this.stuNum="10086";
        System.out.println("构造代码块");
    }
    static {
        classroom="1班";
        System.out.println("静态代码块");
    }

    public Student(String name, int age, float score, String stuNum) {
        this.name = name;
        this.age = age;
        this.score = score;
        this.stuNum = stuNum;
        System.out.println("构造方法");
    }
    public void show(){
        System.out.println("姓名："+this.name+" 年龄："+this.age+" 分数："+this.score+" 学号："+this.stuNum+" 班级："+classroom);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                ", stuNum='" + stuNum + '\'' +
                '}';
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public float getScore() {
        return score;
    }

    public void setScore(float score) {
        this.score = score;
    }


}
public class TextDemo {
    public static void main(String[] args) {
    Student student =new Student("zhangsang",17,99.5F,"111111");
        System.out.println(student);
    //Student student =new Student();
    //student.show();
    }
    public static void main1(String[] args) {
//     Student student1 =new Student();
//     student1.setAge(14);
//        System.out.println(student1.getAge());
//     student1.name ="zhangshang";
//     student1.age =10;
//     student1.source =10;
    }
}
